package com._119yn.host.gst200.constant;

public interface LogTags {

    int TAG_LENGTH = 14;

    static String getTag(String tag) {
        StringBuilder sb = new StringBuilder();
        sb.append("【");
        if (tag.length() > TAG_LENGTH) {
            sb.append(tag, 0, TAG_LENGTH);
        } else if (tag.length() < TAG_LENGTH) {
            int pad = TAG_LENGTH - tag.length();
            sb.append(" ".repeat(pad));
            sb.append(tag);
        } else {
            sb.append(tag);
        }
        sb.append("】");
        return sb.toString();
    }

    static String getMqttReceiver() {
        return getTag("MQTT-RECEIVER");
    }

    static String getMqttPublisher() {
        return getTag("MQTT-PUBLISHER");
    }

    static String getCanSocket() {
        return getTag("CAN-SOCKET");
    }

    static String getDadsClient() {
        return getTag("DADS-CLIENT");
    }

    static String getDtuServer() {
        return getTag("DTU-SERVER");
    }

    static Object getHostServer() {
        return getTag("HOST-SERVER");
    }
}
